<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>手写事件总线</title>
</head>

<body>

  <script src="../dist/sybUtils.js"></script>
  <script>
    const { eventBus } = aUtils
    eventBus.on('add', (data) => {
      console.log('add', data)
    })
    eventBus.on('add2', (data) => {
      console.log('add2', data)
    })
    eventBus.on('delete', (data) => {
      console.log('delete', data)
    })

    eventBus.off('add')
    // eventBus.off()

    eventBus.emit('add', 123)
    eventBus.emit('add2', 'add2')
    eventBus.emit('delete', 'abc')

  </script>
</body>

</html>